package cn.lizemin.demo.thread.blocked;

import cn.lizemin.demo.thread.innerClass.InnerClass;

/**
 * @author: lizemin
 * @version: 1.0
 */
public class BlockedDemo {
    //这是一个main方法,是程序的入口
    public static void main(String[] args) throws InterruptedException {
        //创建一个锁对象
        Object o = new Object();
        //创建线程
        A a = new A("小强", o);
        B b = new B("旺财", o);
        InnerClass innerClass = new InnerClass();
        InnerClass.Inner inner = innerClass.new Inner();
//        InnerClass.inner2 inner2 = innerClass.new inner2();

        a.start();
        b.start();

        Thread.sleep(3000);
        System.out.println("此时线程A的状态："+a.getState());
        System.out.println("此时线程B的状态："+b.getState());



    }

}
